//
// Created by Admin on 2021/9/20.
//

#include "entry.h"

void student_total_average(pStudent students, int student_count, int subject_count){
    for(int i=0;i<student_count;i++){
        int total = 0;
        for(int j=0;j<subject_count;j++){
            total += students[i].subjects[j].score;
        }
        students[i].total_score = total;
        printf("学生%s,学号%d,总分:%d,平均分：%f\n",students[i].name,students[i].number,total,1.0*total/subject_count);
    }
}

void calc_student_total(pStudent students, int student_count, int subject_count){
    for(int i=0;i<student_count;i++){
        int total = 0;
        for(int j=0;j<subject_count;j++){
            total += students[i].subjects[j].score;
        }
        students[i].total_score = total;
    }
}